package com.example.tliasmanagement.controller;

import com.example.tliasmanagement.dto.QuerySubjectDTO;
import com.example.tliasmanagement.dto.SubjectListDto;
import com.example.tliasmanagement.entity.Subject;
import com.example.tliasmanagement.service.SubjectService;
import com.example.tliasmanagement.vo.PageBean;
import com.example.tliasmanagement.vo.Result2;
import com.example.tliasmanagement.vo.SubjectVo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

@Slf4j
@RestController
public class SubjectController {
    @Autowired
    private SubjectService subjectService;

    @GetMapping("/subjects")
    public Result2<PageBean<SubjectVo>> subs(QuerySubjectDTO dto){
        PageBean<SubjectVo> subs = subjectService.subs(dto);
        return Result2.ok(subs);
    }

}
